package com.glory.good_dark.activity;

import com.glory.good_dark.application.App;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.pda.platform.ui.ui_pdaplatform.base.FreeUI_BaseActivity;
import com.pda.platform.ui.ui_pdaplatform.entity.FreeUI_AddViewEntity;
import com.pda.platform.ui.ui_pdaplatform.entity.FreeUI_TabCountEntity;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_ActivityManager;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_StaticMembers;

import java.util.List;


public class MainActivity extends FreeUI_BaseActivity {

    @Override
    protected int getLayoutResId() {
        return 0;
    }

    @Override
    protected void initView() {
        FreeApi_ActivityManager.getActivityManager().addActivity(this);
    }



    @Override
    protected void initData() {
        String json = "[{\n" +
                "\t\t\"title\": \"功能管理\",\n" +
                "\t\t\"normalPicName\": \"function\",\n" +
                "\t\t\"selectPicName\": \"function_select\",\n" +
                "\t\t\"whatFragment\": 1,\n" +
                "\t\t\"tabIndexGridEntityList\": [{\n" +
                "\t\t\t\"picName\": \"start_function\",\n" +
                "\t\t\t\"showPlugin\": \"MultiBatchStartActivity\",\n" +
                "\t\t\t\"text\": \"批次开始操作\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +

                "\t\t}, {\n" +
                "\t\t\t\"picName\": \"end_function\",\n" +
                "\t\t\t\"showPlugin\": \"BatchWorkEndActivity\",\n" +
                "\t\t\t\"text\": \"批次结束操作\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +

                "\t\t}, {\n" +
                "\t\t\t\"picName\": \"end_function\",\n" +
                "\t\t\t\"showPlugin\": \"PPAKWorkEndActivity\",\n" +
                "\t\t\t\"text\": \"PPAK结束作业\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +

                "\t\t}, {\n" +
                "\t\t\t\"picName\": \"project_model\",\n" +
                "\t\t\t\"showPlugin\": \"ProjectModelActivity\",\n" +
                "\t\t\t\"text\": \"工程模式\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +

                "\t\t}, {\n" +
                "\t\t\t\"picName\": \"pm_manger\",\n" +
                "\t\t\t\"showPlugin\": \"PMMangerActivity\",\n" +
                "\t\t\t\"text\": \"PM管理\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +

                "\t\t}, {\n" +
                "\t\t\t\"picName\": \"capacity_manger\",\n" +
                "\t\t\t\"showPlugin\": \"header\",\n" +
                "\t\t\t\"text\": \"产能管理\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.CapacityMangerActivity\"\n" +

//                "\t\t}, {\n" +
//                "\t\t\t\"picName\": \"start_function\",\n" +
//                "\t\t\t\"showPlugin\": \"MultiBatchStartActivity\",\n" +
//                "\t\t\t\"text\": \"多批开始操作\",\n" +
//                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +
//
//
//                "\t\t}, {\n" +
//                "\t\t\t\"picName\": \"end_function\",\n" +
//                "\t\t\t\"showPlugin\": \"MultiBatchEndActivity\",\n" +
//                "\t\t\t\"text\": \"多批结束操作\",\n" +
//                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +

                "\t\t},{\n" +
                "\t\t\t\"picName\": \"unlock\",\n" +
                "\t\t\t\"showPlugin\": \"UnlockActivity\",\n" +
                "\t\t\t\"text\": \"解锁\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +
                "\t\t},{\n" +
                "\t\t\t\"picName\": \"engineering\",\n" +
                "\t\t\t\"showPlugin\": \"LockmachineActivity\",\n" +
                "\t\t\t\"text\": \"锁机\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +
                "\t\t},{\n" +
                "\t\t\t\"picName\": \"warehousing\",\n" +
                "\t\t\t\"showPlugin\": \"RecipeInfoActivity\",\n" +
                "\t\t\t\"text\": \"Recipe下载\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +
                "\t\t},{\n" +
                "\t\t\t\"picName\": \"check\",\n" +
                "\t\t\t\"showPlugin\": \"header\",\n" +
                "\t\t\t\"text\": \"点巡检\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DailyInspectionActivity\"\n" +
                "\t\t}," +

                "{\n" +
                "\t\t\t\"picName\": \"maintenance\",\n" +
                "\t\t\t\"showPlugin\": \"MaterielFoolProofingActivity\",\n" +
                "\t\t\t\"text\": \"物料防呆\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +
                "\t\t}," +

                "{\n" +
                "\t\t\t\"picName\": \"system\",\n" +
                "\t\t\t\"showPlugin\": \"SystemConfigActivity\",\n" +
                "\t\t\t\"text\": \"系统配置\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +
                "\t\t}," +

                "{\n" +
                "\t\t\t\"picName\": \"id\",\n" +
                "\t\t\t\"showPlugin\": \"StripIDMangerActivity\",\n" +
                "\t\t\t\"text\": \"StripId管理\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +
                "\t\t}," +

                "{\n" +
                "\t\t\t\"picName\": \"box\",\n" +
                "\t\t\t\"showPlugin\": \"header\",\n" +
                "\t\t\t\"text\": \"合批\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.MergeLotActivity\"\n" +
                "\t\t}," +

                "{\n" +
                "\t\t\t\"picName\": \"pm\",\n" +
                "\t\t\t\"showPlugin\": \"PMQueryActivity\",\n" +
                "\t\t\t\"text\": \"PM查询\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +
                "\t\t}," +


                "{\n" +
                "\t\t\t\"picName\": \"exit\",\n" +
                "\t\t\t\"showPlugin\": \"Exit\",\n" +
                "\t\t\t\"text\": \"退出系统\",\n" +
                "\t\t\t\"skipClass\": \"com.glory.good_dark.activity.DialogActivity\"\n" +
                "\t\t}]\n" +
                "\t},\n" +
                "\t{\n" +
                "\t\t\"title\": \"我的信息\",\n" +
                "\t\t\"normalPicName\": \"mine\",\n" +
                "\t\t\"selectPicName\": \"mine_select\",\n" +
                "\t\t\"whatFragment\": 3,\n" +
                "\t\t\"tabIndexGridEntityList\": [{\n" +
                "\t\t\t\"picName\": \"\",\n" +
                "\t\t\t\"showPlugin\": \"姓名\",\n" +
                "\t\t\t\"text\": \"姓名\",\n" +
                "\t\t\t\"content\": \""+ App.userEntity.getNAME()+"\",\n" +
                "\t\t\t\"skipClass\": \"\"\n" +
                "\t\t}, {\n" +
                "\t\t\t\"picName\": \"\",\n" +
                "\t\t\t\"showPlugin\": \"工号\",\n" +
                "\t\t\t\"text\": \"工号\",\n" +
                "\t\t\t\"content\": \""+ App.userEntity.getWORKNO()+"\",\n" +
                "\t\t\t\"skipClass\": \"\"\n" +
                "\t\t}, {\n" +
                "\t\t\t\"picName\": \"\",\n" +
                "\t\t\t\"showPlugin\": \"手机号\",\n" +
                "\t\t\t\"text\": \"手机号\",\n" +
                "\t\t\t\"content\": \""+ App.userEntity.getPHONE()+"\",\n" +
                "\t\t\t\"skipClass\": \"\"\n" +
                "\t\t}, {\n" +
                "\t\t\t\"picName\": \"\",\n" +
                "\t\t\t\"showPlugin\": \"邮箱\",\n" +
                "\t\t\t\"text\": \"邮箱\",\n" +
                "\t\t\t\"content\": \""+ App.userEntity.getEMAIL()+"\",\n" +
                "\t\t\t\"skipClass\": \"\"\n" +
                "\t\t}, {\n" +
                "\t\t\t\"picName\": \"\",\n" +
                "\t\t\t\"showPlugin\": \"职位\",\n" +
                "\t\t\t\"text\": \"职位\",\n" +
                "\t\t\t\"content\": \""+ App.userEntity.getROLENAME()+"\",\n" +
                "\t\t\t\"skipClass\": \"\"\n" +
                "\t\t}, {\n" +
                "\t\t\t\"picName\": \"\",\n" +
                "\t\t\t\"showPlugin\": \"班别\",\n" +
                "\t\t\t\"text\": \"班别\",\n" +
                "\t\t\t\"content\": \""+ App.userEntity.getSHIFT()+"\",\n" +
                "\t\t\t\"skipClass\": \"\"\n" +
                "\t\t}]\n" +
                "\t}\n" +
                "]";

        List<FreeUI_TabCountEntity> entity = new Gson().fromJson(json, new TypeToken<List<FreeUI_TabCountEntity>>() {
        }.getType());
        goHomeActivity(0, FreeApi_StaticMembers.THEME_SKY_BLUE, getBytesList(entity));
        FreeApi_ActivityManager.getActivityManager().finishActivity();
    }

    @Override
    protected FreeUI_AddViewEntity getBaseEntity() {
        return null;
    }
}
